package com.gd.iot.energy.dao.statistics;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.gd.iot.energy.po.statistics.ReportHistorydataPO;
import com.gd.iot.energy.pojo.statistics.dto.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ReportHistorydataPOMapper extends BaseMapper<ReportHistorydataPO> {

    IPage<StatisticsDTO> selectYearToYearPage(IPage<StatisticsDTO> page,
                                              @Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper,
                                              @Param("ewOrder") QueryWrapper<StatisticsDTO> queryWrapperOrder,
                                              @Param("beginDate") String beginDate,
                                              @Param("endDate") String endDate,
                                              @Param("lastYearBeginDate") String lastYearBeginDate,
                                              @Param("lastYearEndDate") String lastYearEndDate,
                                              @Param("archiveIds") List<Long> archiveIds);

    StatisticsDTO selectYearToYearChart(@Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper,
                                        @Param("beginDate") String beginDate,
                                        @Param("endDate") String endDate,
                                        @Param("lastYearBeginDate") String lastYearBeginDate,
                                        @Param("lastYearEndDate") String lastYearEndDate,
                                        @Param("archiveIds") List<Long> archiveIds);

    List<StatisticsDTO> selectTrendChart(@Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper);

    IPage<UserDosagePageDTO> selectUserDosagePage(IPage<StatisticsDTO> page,
                                                  @Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper);

    List<UserDosageChartDTO> selectUserDosageChart(@Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper);

    IPage<ZeroDosagePageDTO> selectZeroDosagePage(IPage<StatisticsDTO> page,@Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper);

    IPage<JumpAndAnticlimaxPageDTO> selectJumpAndAnticlimaxPage(IPage<StatisticsDTO> page,
                                                                @Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper,
                                                                @Param("differenceType") String differenceType,
                                                                @Param("differenceValue") String differenceValue);

    List<JumpAndAnticlimaxChartDTO> selectJumpAndAnticlimaxChart( @Param(Constants.WRAPPER) QueryWrapper<StatisticsDTO> queryWrapper,
                                                                  @Param("differenceType") String differenceType,
                                                                  @Param("differenceValue") String differenceValue);
}